home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / CAppendiceThumb.as < prev    next >
Text File  |  2007-11-08  |  2KB  |  89 lines

  1. class CAppendiceThumb extends mx.core.UIObject
  2. {
  3.    function CAppendiceThumb()
  4.    {
  5.       super();
  6.       this.mInitialized = false;
  7.       this.Hide();
  8.       this.doLater(this,"init");
  9.    }
  10.    function init()
  11.    {
  12.       this.mInitialized = true;
  13.       this.mc_ImgTitolo.html = true;
  14.       this.mc_ImgTitolo.multiline = true;
  15.       this.mc_ImgTitolo.embedFonts = _global.gUseEmbeddedFont;
  16.       this.mc_ImgTitolo.styleSheet = _global.gStyleManager.GetCSS();
  17.       this.mc_ImgThumb.addEventListener("progres",mx.utils.Delegate.create(this,this.onThumbLoadingProgress));
  18.       this.mc_ImgThumb.addEventListener("complete",mx.utils.Delegate.create(this,this.onThumbLoadingComplete));
  19.       this.mc_ImgThumb.setStyle("border","solid");
  20.       this.mc_ImgIcona.setStyle("border","solid");
  21.    }
  22.    function LayoutWindow()
  23.    {
  24.    }
  25.    function onPress()
  26.    {
  27.       if(_root.gAppendiceSearch)
  28.       {
  29.          this.mMedia.mFrom = "lemma";
  30.          if(this.mMedia.mTipo == "P")
  31.          {
  32.             _root.gAppendiceSearch.MostraProspettiva(this.mMedia.mId,"P",this.mMedia.mTitolo,"lemma",true);
  33.          }
  34.          else
  35.          {
  36.             _root.gAppendiceSearch.OpenContributiWindow(this.mMedia);
  37.          }
  38.       }
  39.    }
  40.    function IconManager(tipo)
  41.    {
  42.       switch(tipo)
  43.       {
  44.          case "L":
  45.             return "lemmaIconBig";
  46.          case "R":
  47.             return "rinvioIconBig";
  48.          case "T":
  49.             return "tabIconBig";
  50.          case "I":
  51.             return "imageIconBig";
  52.          case "F":
  53.             return "imageIconBig";
  54.          case "P":
  55.             return "prospettivaIconBig";
  56.          default:
  57.             return "emptyIcon";
  58.       }
  59.    }
  60.    function onThumbLoadingProgress(evtObj)
  61.    {
  62.    }
  63.    function onThumbLoadingComplete(evtObj)
  64.    {
  65.    }
  66.    function SetMedia(inMedia)
  67.    {
  68.       this.mMedia = inMedia;
  69.       this.mc_ImgTitolo.htmlText = "<span class=\'s_titoloThumbPreview\'>" + StringUtils.HtmlFunction(inMedia.mTitolo) + "</span>";
  70.       this.mc_ImgThumb.__set__contentPath(inMedia.GetThumbPath());
  71.       this.mc_ImgIcona.__set__contentPath(this.IconManager(inMedia.mTipo));
  72.       this.Show();
  73.    }
  74.    function Hide(Void)
  75.    {
  76.       this._visible = false;
  77.    }
  78.    function Show(Void)
  79.    {
  80.       if(!this._visible)
  81.       {
  82.          this._visible = true;
  83.       }
  84.    }
  85.    function clearUI()
  86.    {
  87.    }
  88. }
  89.